package com.slz3.business.module.messageManagement.mesSystem.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.messageManagement.mesSystem.domain.MesSystem;
import com.slz3.business.module.messageManagement.mesSystem.domain.MesSystemCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MesSystemResController {

    static Mono<ServerResponse> add(ServerRequest req, MesSystem mesSystem) {
        if (MesSystemResUnsafeValid.add(req, mesSystem)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.add_$MesSystemUpdateLock(req, mesSystem);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, MesSystemCondition mesSystemCondition) {
        if (MesSystemResUnsafeValid.delete(req, mesSystemCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.delete_$MesSystemUpdateLock(req, mesSystemCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, MesSystem mesSystem) {
        if (MesSystemResUnsafeValid.modify(req, mesSystem)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.modify_$MesSystemUpdateLock(req, mesSystem);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (MesSystemResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (MesSystemResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.info_$MesSystemUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (MesSystemResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, MesSystemCondition mesSystemCondition) {
        //
        if (MesSystemResUnsafeValid.auditSubmit(req, mesSystemCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.auditSubmit_$MesSystemUpdateLock(req, mesSystemCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, MesSystemCondition mesSystemCondition) {
        if (MesSystemResUnsafeValid.audit(req, mesSystemCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.audit_$MesSystemUpdateLock(req, mesSystemCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, MesSystemCondition mesSystemCondition) {
        if (MesSystemResUnsafeValid.auditReject(req, mesSystemCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.auditReject_$MesSystemUpdateLock(req, mesSystemCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, MesSystemCondition mesSystemCondition) {
        if (MesSystemResUnsafeValid.usingEnable(req, mesSystemCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.usingEnable_$MesSystemUpdateLock(req, mesSystemCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, MesSystemCondition mesSystemCondition) {
        if (MesSystemResUnsafeValid.usingDisable(req, mesSystemCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesSystemResAtomic.usingDisable_$MesSystemUpdateLock(req, mesSystemCondition);
        }
    }

}
